UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6wwD6cq4MaElv8Bggv9NJb17GrmT4wJONT6ivFHQrqI=' 
WHERE 
  key_id = '49b95cf06a9ef9e7ec3715445c9cb6ce4d6a2a281b3a3967eb82d16538a2d088' 
  AND (
    token = '6wwD6cq4MaElv8Bggv9NJb17GrmT4wJONT6ivFHQrqI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037