UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fcqopEyJvYH1DvOn98bbCpG5hCpLBjygL9BE/GLf7Qo=' 
WHERE 
  key_id = '0291793424a04838e4c7bd45acccb493738ed2ba1d1fc65144281a0bb643790b' 
  AND (
    token = 'fcqopEyJvYH1DvOn98bbCpG5hCpLBjygL9BE/GLf7Qo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020