UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NxomI6auqexvC0bDngeco/PIuy9Jsd2LDd2un0YXupY=' 
WHERE 
  key_id = '01957408b36564b9f7e81ffa7c2679c85c1fdbe72268af4212b0e9e3bb1e191d' 
  AND (
    token = 'NxomI6auqexvC0bDngeco/PIuy9Jsd2LDd2un0YXupY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037