UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+zD2qcTVr+df/aR+EeFkMQAO0xTJPRNKa4qGEauWo8Q=' 
WHERE 
  key_id = '5e1c696caf399456a2ca25a758a6ebe00654351b5f5d6e7313ad3ee5cf3ae262' 
  AND (
    token = '+zD2qcTVr+df/aR+EeFkMQAO0xTJPRNKa4qGEauWo8Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031