UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wkQM7i4I9NrWV6juFh2CApd+TzsZaQMTMr1B6VIQU7c=' 
WHERE 
  key_id = '9cd7937fccf383f45ba07a27a81cef9a8980134bab240046a6ca19460d9f4c14' 
  AND (
    token = 'wkQM7i4I9NrWV6juFh2CApd+TzsZaQMTMr1B6VIQU7c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048