UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AwwmijKQUQkAZ2HOOY6Y3iVOOGeQ/sxk0lsSOFbnROU=' 
WHERE 
  key_id = 'eff671d39a3d39e42d17b40f0009ecf8cc800277badec693c8100c84d1e76db8' 
  AND (
    token = 'AwwmijKQUQkAZ2HOOY6Y3iVOOGeQ/sxk0lsSOFbnROU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026