UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XDRJxrLCy+VIyY90vbPY/zbNPGFnBfL7AubldYrwu5s=' 
WHERE 
  key_id = '76c3abb3186b7b56f1cadf5cc96744259b3af062045459414da85a9ca867a924' 
  AND (
    token = 'XDRJxrLCy+VIyY90vbPY/zbNPGFnBfL7AubldYrwu5s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027