UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D+MX0w4uHAD1/WyFpwPjRSMpfOxrjd99OzTMd+jXEQY=' 
WHERE 
  key_id = 'c880faa158bf1a03fe60bffaa2f31f2286fea43cb4c9c4d5f6f256a2c0e63afa' 
  AND (
    token = 'D+MX0w4uHAD1/WyFpwPjRSMpfOxrjd99OzTMd+jXEQY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046