UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rA7ky75xRg3TX28OY9tVxbfjz24EptW1SUG02Bkf4eU=' 
WHERE 
  key_id = 'f0186d44b8cd2bb4afbbc91f75eb662da1556fd72c61bb0c3ce69408eeeed06f' 
  AND (
    token = 'rA7ky75xRg3TX28OY9tVxbfjz24EptW1SUG02Bkf4eU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030