UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0kqJw0et4D2nuw+PYPZ89vTnmYepV+0MvgDPsKv1Qxk=' 
WHERE 
  key_id = '0f6eeaec99b8a514bf4d3e173ee61e0eddf4b6ba2b61e313bd01c8965c45b69c' 
  AND (
    token = '0kqJw0et4D2nuw+PYPZ89vTnmYepV+0MvgDPsKv1Qxk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033