UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kBxUVAm7h/KzamFD5r76df3pwHcYLkGxwDJG/lfhQIE=' 
WHERE 
  key_id = '0c49da475ec7777994bcbcd645ce48d5285ad7e2fb6b82c9a9c9541cc36316ad' 
  AND (
    token = 'kBxUVAm7h/KzamFD5r76df3pwHcYLkGxwDJG/lfhQIE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024