UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZjA7KwD0M41ig8Nk+ca4OM4lyFuqbnLpurNis3bPsPY=' 
WHERE 
  key_id = 'a0e4beae85c1f0b3c1939dad09409d09f70b7f027b2e36bbd74127a28a954eba' 
  AND (
    token = 'ZjA7KwD0M41ig8Nk+ca4OM4lyFuqbnLpurNis3bPsPY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027