UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G+tJf/QgN58GnLPbrVm5f9CVqGDy74Eh7kZnl8j08iI=' 
WHERE 
  key_id = 'fe9a54cbbbcd4e8e55aa6dd72e0cb8cae657334ae26cfffe9b27e142b9ad5eb6' 
  AND (
    token = 'G+tJf/QgN58GnLPbrVm5f9CVqGDy74Eh7kZnl8j08iI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032