UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b5CmG0cfX9OSEGcxNcJ2iadGUojvANW9uoo/Cwy6jXY=' 
WHERE 
  key_id = '0630cc85956f473ec7f7f914fef5f68d3c45c776fd77041e25d6e4ace208da55' 
  AND (
    token = 'b5CmG0cfX9OSEGcxNcJ2iadGUojvANW9uoo/Cwy6jXY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016