UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6zO7QgyaeKSUTKbOk6HmQHY4Nm/Gn4KVqeT4dxFfC2Q=' 
WHERE 
  key_id = '1ef2e967e707c7e42693a2f509ee81ddf25bbf428975fa1925a50cfad2c70f4d' 
  AND (
    token = '6zO7QgyaeKSUTKbOk6HmQHY4Nm/Gn4KVqeT4dxFfC2Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034