UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UcIm9Wo+izs7GwuoKiLX8ZAwlbffsJqS3oOk4A7/07I=' 
WHERE 
  key_id = 'e96c03b2e9c6a13553412b8f9a8bbf1ff7eea23f59fd54a508fa7472595cadfb' 
  AND (
    token = 'UcIm9Wo+izs7GwuoKiLX8ZAwlbffsJqS3oOk4A7/07I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059