UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yCnLFeTbJpwc9040pIQ3xgcjTZTRAhIf+xoWvQRVcKE=' 
WHERE 
  key_id = '03c45578ce3bb4adb82cbb711e88036b00728da012f39a861d498493946bad4e' 
  AND (
    token = 'yCnLFeTbJpwc9040pIQ3xgcjTZTRAhIf+xoWvQRVcKE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027