UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XIkzfDzDtFkY/CxNagUzPgiCrChyZOU1wPtI/unr8MQ=' 
WHERE 
  key_id = '0427ee497afbda46e9273d3affbaeb0470bd1531f811c3b6259331ade5d07f34' 
  AND (
    token = 'XIkzfDzDtFkY/CxNagUzPgiCrChyZOU1wPtI/unr8MQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030