UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wntuMpbDtq6wlb6t/Qi3XnZHsDcJx6i5RPusGi+kKgk=' 
WHERE 
  key_id = '259375e91dc0d4c179c63de5602ea2ccab4b8eb418a7bd76451d468b6faddc81' 
  AND (
    token = 'wntuMpbDtq6wlb6t/Qi3XnZHsDcJx6i5RPusGi+kKgk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032