UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8SXBOPeLD8sJOyQnb+UdykqNFy+6Cr7804+KM4L9CH4=' 
WHERE 
  key_id = 'b4b7073b78c6295e2528c4b2a80bb87b5ea91eef5071a2bb23f57e382650d921' 
  AND (
    token = '8SXBOPeLD8sJOyQnb+UdykqNFy+6Cr7804+KM4L9CH4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046