UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ebp4bn4GtKQjDmMG9p0hSBPESZwUBV0ofec6gCvlM+k=' 
WHERE 
  key_id = '8085f40a80e3624d10a136e0953f285f100de4737f0d7fb88445a1a5c936bd9a' 
  AND (
    token = 'Ebp4bn4GtKQjDmMG9p0hSBPESZwUBV0ofec6gCvlM+k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038