UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4P5w/Ee0+0vCgma+p5Q88b4cwcn19Lv4CadxP5C0ezQ=' 
WHERE 
  key_id = 'd3cad5175758c4298b20282013a35b851fd3423a0f63671a324f0568bd0bb994' 
  AND (
    token = '4P5w/Ee0+0vCgma+p5Q88b4cwcn19Lv4CadxP5C0ezQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034