UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sr4V512fV0Q+0UDXCHlrdpL5STFDCcP6NgYrkp9Penk=' 
WHERE 
  key_id = '7f364ca89e5e6214b4b3e0f727a2e2c708c4618484a819f3a3be09dfaf18f0b2' 
  AND (
    token = 'sr4V512fV0Q+0UDXCHlrdpL5STFDCcP6NgYrkp9Penk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026