UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8H0NtsvMMw/fQmuWD+/L3gG0HNRDMVR23nvQv1PNaxw=' 
WHERE 
  key_id = '9b9fe157e197aaa290a4ebc0368a1eb6c7fa81ebefc7663c7f6b9ed3b167879a' 
  AND (
    token = '8H0NtsvMMw/fQmuWD+/L3gG0HNRDMVR23nvQv1PNaxw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027