UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rIZICvEBhD1beZqeVrSSuKIwt1qa9drnhYB9Cd9NzFE=' 
WHERE 
  key_id = '9807d280e428cd5699b9b94ad6141bbfe1aecf75467d7dd4ee864d7b2e70d813' 
  AND (
    token = 'rIZICvEBhD1beZqeVrSSuKIwt1qa9drnhYB9Cd9NzFE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029