UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RLlaujFJltNHuPrKDJUZa3xbYS9cGJpplccw9j47dlk=' 
WHERE 
  key_id = '65134cb74f26fab60fad52138771c36901b71b1eaf57b8a24eba4a073236b6e4' 
  AND (
    token = 'RLlaujFJltNHuPrKDJUZa3xbYS9cGJpplccw9j47dlk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042