UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SmNSVXbtg1ZeLQ9GbkR6yvCZfYzvkTw89jgjNMRYwuM=' 
WHERE 
  key_id = 'ed3349fb11956fe798768a0602c74bb4522a90e9d7943205c630fe5780012b48' 
  AND (
    token = 'SmNSVXbtg1ZeLQ9GbkR6yvCZfYzvkTw89jgjNMRYwuM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026