UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k3cLsN0wmtdIMh/ubt4vNy71EAEPVWkzmpg8UGd7A2I=' 
WHERE 
  key_id = '5a8e0671069d2089870ee8428fc6424a94495a52bc2b4fb7da70b5e13d00025f' 
  AND (
    token = 'k3cLsN0wmtdIMh/ubt4vNy71EAEPVWkzmpg8UGd7A2I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027