UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vbdJ6Y06wOrsu2k9lyHPvz5a8sYUtzYjTiKRNDbjrMk=' 
WHERE 
  key_id = '4d4b6cab5c8e9e94d7a0039cb1125b4285111ac2546a509f20ce8aacba01c28e' 
  AND (
    token = 'vbdJ6Y06wOrsu2k9lyHPvz5a8sYUtzYjTiKRNDbjrMk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032