UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eJ814RQQNjB/JbBiVkFQlTyv7aMx2x+L6IMiYN1Nx58=' 
WHERE 
  key_id = 'a8045cf0074af8bc523ba29c485db6eefd826fa310e2f64a353e6f597cfbb44b' 
  AND (
    token = 'eJ814RQQNjB/JbBiVkFQlTyv7aMx2x+L6IMiYN1Nx58=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034