UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sLoEhJGpyv6f1U+Hd74RJRMYOW4LkLfWLifaX6ok9VE=' 
WHERE 
  key_id = '092f678c30a7a0b4693f7961fcbb548c4cd51d8df976828059975ddb270d2c8c' 
  AND (
    token = 'sLoEhJGpyv6f1U+Hd74RJRMYOW4LkLfWLifaX6ok9VE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024