UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RMGKYvKiXxyFvwmY8jlFEJdlq2/2Di+OLPlthjj/5yU=' 
WHERE 
  key_id = '74d2b67b3b55dcc5e9aacf46622e0230b58fe72afcbc21d1501a8ea4d898b690' 
  AND (
    token = 'RMGKYvKiXxyFvwmY8jlFEJdlq2/2Di+OLPlthjj/5yU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050