UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6dXKGgWrgp0HRGLaf//sRvW+j3iJVsKlFype2433hKU=' 
WHERE 
  key_id = '2579ca68f39ff35ae67b563f9ae684da72214257e31f19f024892441edcb9840' 
  AND (
    token = '6dXKGgWrgp0HRGLaf//sRvW+j3iJVsKlFype2433hKU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035