UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ACsnROCQ0oJJdRosYCU2F73n68S+Xnbr4lMwIvdZv3A=' 
WHERE 
  key_id = '16ed63bd750d779a4a7c2791e0a790b2ff19f08da34415771d50028295b34ab9' 
  AND (
    token = 'ACsnROCQ0oJJdRosYCU2F73n68S+Xnbr4lMwIvdZv3A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035