UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TYFZMdRvCe/1+gfXcSD+L/Zgatv0u6OirsjS9pr2yQU=' 
WHERE 
  key_id = '7543ff90ce31ab76fb982efe039147ce02c3ef406158f1f7a3c707a178f29c70' 
  AND (
    token = 'TYFZMdRvCe/1+gfXcSD+L/Zgatv0u6OirsjS9pr2yQU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044