UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BxZWIsAw9rSyIUyiDvZmyru46s59xEcjj288/wHtR30=' 
WHERE 
  key_id = '5073a5cca13cb9ff4270005db2f305df7529bec0f5ee51c043ff02af5b7adee9' 
  AND (
    token = 'BxZWIsAw9rSyIUyiDvZmyru46s59xEcjj288/wHtR30=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021