UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EJ96lNxWJ3gxzZWzFfP9+ypiw+bZIuz1Ha9p/KGn67g=' 
WHERE 
  key_id = '4b32291b893515da62a223a6f386a6804df5858d75523600d5aef26cc68da389' 
  AND (
    token = 'EJ96lNxWJ3gxzZWzFfP9+ypiw+bZIuz1Ha9p/KGn67g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015