UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jrInMP8PjhZC+ThFRsnMou7Satp/mecxqqbIv8AeRgE=' 
WHERE 
  key_id = 'bd71824994ca63f9cb61927393babf672e116fa6d5d0c3c8d44ca98f4180d2f5' 
  AND (
    token = 'jrInMP8PjhZC+ThFRsnMou7Satp/mecxqqbIv8AeRgE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030