UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7B2uPcgNT8R6F4PwlaNQ31J2O7Sd/fl+dOd0qfSitlg=' 
WHERE 
  key_id = '1b37234c7798accfba4574c76484c832c6981ac1c9cd61b3b71f50cf50b32466' 
  AND (
    token = '7B2uPcgNT8R6F4PwlaNQ31J2O7Sd/fl+dOd0qfSitlg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018