UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bgwrETOYHVYOrslpeNcwCm5ru6/J0drtI3mvSxvoxKM=' 
WHERE 
  key_id = '6bb039a8f3b35ae840e3f4f466ed1cdb9360afcbf9b23c15db63604f712f7312' 
  AND (
    token = 'bgwrETOYHVYOrslpeNcwCm5ru6/J0drtI3mvSxvoxKM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040