UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x9PVf62EYpDlbMmq5ti8jlPC51lsi+ZZ6D1tRZPhiSk=' 
WHERE 
  key_id = '9b4d6c9d1008e9368579f4bc3ca7275805f48637c90ffe270a1b23103393e9fd' 
  AND (
    token = 'x9PVf62EYpDlbMmq5ti8jlPC51lsi+ZZ6D1tRZPhiSk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033