UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6A2N4fUq98Nd1fnRcDwHgAg24i4E3L5QJ+SkboadA/A=' 
WHERE 
  key_id = '3f439ae99cc06a7568ff13bf091c37583a53378c584e8d7c13b8b61c2cc6feb2' 
  AND (
    token = '6A2N4fUq98Nd1fnRcDwHgAg24i4E3L5QJ+SkboadA/A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043