UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZvCKI8fk+cJDD6LEPcO0I5nOTdj5WFavDGdfXC9uEOc=' 
WHERE 
  key_id = '12d56cd61dc19c44fec428bafd69c8f390484363bcbab8b3ddd76aff77d779f2' 
  AND (
    token = 'ZvCKI8fk+cJDD6LEPcO0I5nOTdj5WFavDGdfXC9uEOc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031