UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6Rd6sJ1fYZ9klONKU5aegSXp3wvVydEr+tI0tNx9Uo0=' 
WHERE 
  key_id = '1f3c41ca2e5414c337ccb55f788892ffae7b2a1a8e49de6baa36423409f50784' 
  AND (
    token = '6Rd6sJ1fYZ9klONKU5aegSXp3wvVydEr+tI0tNx9Uo0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043