UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'O5kkrpV3ww+/lVJWDtQDebsm3P9sQOkKZy+CWO1KILg=' 
WHERE 
  key_id = '4d35a0cfeedb70a4d3dac6318e08753549db4d3a17890e15e7d60b38461fb78c' 
  AND (
    token = 'O5kkrpV3ww+/lVJWDtQDebsm3P9sQOkKZy+CWO1KILg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035