UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vLumsuVRkMCnt5Bkew6zxK52Ybyq3Dn8g4nN5EPr1Vo=' 
WHERE 
  key_id = '8025c56706354eb45b11f2b29e7a237688a181e0efa8ac7704dce267bca331f6' 
  AND (
    token = 'vLumsuVRkMCnt5Bkew6zxK52Ybyq3Dn8g4nN5EPr1Vo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053