UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SNhE8VG36/8DuU0MwQC3A4jRK1TIv8EbRh22895mJ6A=' 
WHERE 
  key_id = '4557155d50958ecb753ddcce6cef62c049bb949fa69e094874082e9d433f14d7' 
  AND (
    token = 'SNhE8VG36/8DuU0MwQC3A4jRK1TIv8EbRh22895mJ6A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00066