UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+RboNWFkiV1zO8y0ieghhjJVY26XHNTv6fMjv1aT1k0=' 
WHERE 
  key_id = '016a0c34372db3b5fc875f55d698ed6cfe9d3c3ddbebafd5ce9eee935bb8f472' 
  AND (
    token = '+RboNWFkiV1zO8y0ieghhjJVY26XHNTv6fMjv1aT1k0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040