UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QvcExX5omRkRP+65DQ5lyD13bz+pp8JFCuz9ctQwLzo=' 
WHERE 
  key_id = '29f9d5c32931207c5e1dc7a975826f93022bec3509859f5bd255db851dd0a45c' 
  AND (
    token = 'QvcExX5omRkRP+65DQ5lyD13bz+pp8JFCuz9ctQwLzo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030