UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'agvxJRE1G+dTRfdSsrWmIY/WN2KqfVpDDopYJc8eeUE=' 
WHERE 
  key_id = '2ab9bd6102610858e6f12b6d97fd501f2cffa999f499487e4bfa153ffc8420ee' 
  AND (
    token = 'agvxJRE1G+dTRfdSsrWmIY/WN2KqfVpDDopYJc8eeUE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031