UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/k4f2eJ176Dix/7OUti059dsITrPOdbcIBUQpEEarTE=' 
WHERE 
  key_id = '7970d3b3705bbb9f0b7bb9b4c507ad8d7ec54e39fd0513ee1ea1017509d1ba47' 
  AND (
    token = '/k4f2eJ176Dix/7OUti059dsITrPOdbcIBUQpEEarTE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032