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

Query time 0.00035